<?php

 
// no direct access
defined( '_JEXEC' ) or die( 'Restricted access' );

class TableConfig extends HelpDeskTable {

	var $id						= null;
	var $title					= null;
	var $description			= null;
	var $ordering				= 99; 	
	var $published				= 0; 	
	var $checked_out			= null; 	
	var $checked_out_time		= null; 	
	var $value					= null;

	function TableConfig( &$db ) {
		parent::__construct( '#__helpdesk_config', 'title', $db );	
	}
	
	function store( $updateNulls = true) {
		$k = 'id';
 
        if (intval( $this->$k) > 0 )
        {
            $ret = $this->_db->updateObject( $this->_tbl, $this, $this->_tbl_key );
        }
        else
        {
            $ret = $this->_db->insertObject( $this->_tbl, $this, $this->_tbl_key );
        }
        if( !$ret )
        {
            $this->setError(get_class( $this ).'::store failed - '.$this->_db->getErrorMsg());
            return false;
        }
        else
        {
            return true;
        }
	}
    
}